import {http} from "@/utils/http";

export const getDeviceList = (data) => {
    return http({
        url:"/api/machine/page",
        method: 'get',
        data
    })
}

export const getDeviceDetail = (id) => {
    return http({
        url:"/api/machine/detail",
        method: 'get',
        data:{
            id: id
        }
    })
}

export const addDevice = (data) => {
    return http({
        url:'/api/machine/add',
        data: data
    })
}

export const updateDevice = (data) => {
    return http({
        url:'/api/machine/edit',
        data: data
    })
}

export const setParams = (data) => {
    return http({
        url:'/api/machine/setparams',
        data: data
    })
}

export const testDevice = (data) => {
    return http({
        url:'/api/machine/test',
        data: data
    })
}

export const allocateDevice = (data) => {
    return http({
        url:'/api/machine/distribute',
        data: data
    })
}

export const reAllocateDevice = (data) => {
    return http({
        url:'/api/machine/redistribute',
        data: data
    })
}

export const enableOrDisableDevice = (data) => {
    return http({
        url:'/api/machine/enable',
        data: data
    })
}

export const replaceBoard = (data) => {
    return http({
        url:'/api/machine/change',
        data: data
    })
}

export const abandonDevice = (data) => {
    return http({
        url:'/api/machine/stop',
        data: data
    })
}

export const getOperators = (data) => {
    return http({
        url:'/api/operator/page',
        method: 'get',
        data: data
    })
}

export const getDeviceSecret = (data) => {
    return http({
        url:'/api/machine/getDeviceSecret',
        method: 'get',
        data: data
    })
}
